// 数据回填
let form = layui.form
function recover() {
    $.ajax({
        url: '/my/user/userinfo',
        success: function (res) {
            console.log(res);
            form.val('user', res.data)
        }
    })
}
recover()

$('form').on('submit', function (e) {
    e.preventDefault()
    let data = $(this).serialize()
    console.log(data);
    $.ajax({
        url: '/my/user/userinfo',
        type: 'POST',
        data: data,
        success: function (res) {
            layer.msg(res.message)
            if (res.status === 0) {

                window.parent.renderuser()
            }
        }
    })
})
$('.reset').on('click', function () {
    recover()
})